package com.neusoft.utils.jsp;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;

public class TestTag extends TagSupport {

    /**
	 *  
	 */
	private static final long serialVersionUID = 7993561430778220336L;
	private String user;
    @Override

    public int doStartTag() throws JspException {

        try {

            JspWriter out = this.pageContext.getOut();

            if(user == null) {

                out.println("No UserInfo Found...");

                return SKIP_BODY;

            }
            out.println(user);


        } catch(Exception e) {

            throw new JspException(e.getMessage());

        }

        return SKIP_BODY;

    }

    @Override

    public int doEndTag() throws JspException {

        return EVAL_PAGE;

    }

    @Override

    public void release() {

        super.release();

        this.user = null;

    }

    //getter and setters

    public String getUser() {

        return user;

    }

    public void setUser(String user) {

        this.user = user;

    }

}